//
//  BVAllCityTool.m
//  BuyVegetable
//
//  Created by yushanchang on 16/10/24.
//  Copyright © 2016年 com.yinding. All rights reserved.
//

#import "BVAllCityTool.h"
#import "BVAllAddress.h"

@interface BVAllCityTool ()

@end

@implementation BVAllCityTool

/**
 *  获取城市列表
 */
+ (void)fetchPickerAddress:(void (^)(NSArray *))success {
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"all_city" ofType:@"json"];
    NSData *jsondata = [[NSData alloc] initWithContentsOfFile:filePath];
    NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsondata options:0 error:nil];
    
    NSArray *addressArr = [BVAllAddress mj_objectArrayWithKeyValuesArray:dict[@"citylist"]];
    
    success(addressArr);
}


@end
